package top.lixunda.ecommerce.server.good.api.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import top.lixunda.commerce.common.core.entity.MessageObject;
import top.lixunda.ecommerce.server.good.api.entity.dto.PageIndexCarouselChangeDTO;
import top.lixunda.ecommerce.server.good.api.entity.dto.PageIndexCarouselInsertDTO;
import top.lixunda.ecommerce.server.good.api.entity.dto.PageIndexFeaturedChangeDTO;
import top.lixunda.ecommerce.server.good.api.entity.dto.PageIndexFeaturedInsertDTO;
import top.lixunda.ecommerce.server.good.api.entity.vo.PageCarouselVO;
import top.lixunda.ecommerce.server.good.api.entity.vo.PageFeaturedVO;

import java.util.List;

/**
 * 首页数据展示获取与设置
 * @author lixunda
 * @version time:2020/3/18 16:31
 */
@Api("首页数据展示获取与设置")
@RequestMapping("pageIndexController")
public interface IPageIndexController {

    /**
     * 获取首页走马灯数据
     *
     * @return PageCarouselVO列表
     */
    @ApiOperation("获取首页走马灯数据")
    @GetMapping("queryCarouselVO")
    MessageObject<List<PageCarouselVO>> queryCarouselVO();

    /**
     * 添加保存一条首页的Carousel数据
     *
     * @param pageIndexCarouselInsertDTO 保存数据
     * @return 是否保存成功
     */
    @ApiOperation("添加保存一条首页的Carousel数据")
    @PostMapping("insertIndexCarousel")
    MessageObject<Boolean> insertIndexCarousel(@RequestBody PageIndexCarouselInsertDTO pageIndexCarouselInsertDTO);

    /**
     * 添加保存一条首页的Carousel数据
     *
     * @param list 保存数据列表
     * @return 是否保存成功
     */
    @ApiOperation("添加保存一条首页的Carousel数据")
    @PostMapping("insertIndexCarouselBatch")
    MessageObject<Boolean> insertIndexCarouselBatch(@RequestBody List<PageIndexCarouselInsertDTO> list);

    /**
     * 修改首页轮播图数据
     * @param pageIndexCarouselChangeDTO 轮播图数据修改DTO
     * @return 是否修改成功
     */
    @ApiOperation("修改首页轮播图数据")
    @PostMapping("changeIndexCarousel")
    MessageObject<Boolean> changeIndexCarousel(@RequestBody PageIndexCarouselChangeDTO pageIndexCarouselChangeDTO);

    /**
     * 根据id移除数据
     *
     * @param ids 轮播图数据编号列表
     * @return 是否移除成功
     */
    @ApiOperation("根据id移除数据")
    @PostMapping("removeIndexCarouselByIds")
    MessageObject<Boolean> removeIndexCarouselByIds(@RequestBody List<Integer> ids);

    /**
     * 获取首页Featured数据
     *
     * @return PageFeaturedVO列表
     */
    @ApiOperation("获取首页Featured数据")
    @GetMapping("queryFeaturedVO")
    MessageObject<List<PageFeaturedVO>> queryFeaturedVO();

    /**
     * 添加保存一条首页的Featured数据
     *
     * @param pageIndexFeaturedInsertDTO 保存数据
     * @return 保存后的数据，为空表示失败
     */
    @ApiOperation("添加保存一条首页的Featured数据")
    @PostMapping("insertIndexFeatured")
    MessageObject<PageFeaturedVO> insertIndexFeatured(@RequestBody PageIndexFeaturedInsertDTO pageIndexFeaturedInsertDTO);

    /**
     * 添加保存多条首页的Featured数据
     *
     * @param list 保存数据列表
     * @return 保存后的数据，为空表示失败
     */
    @ApiOperation("添加保存多条首页的Featured数据")
    @PostMapping("insertIndexFeaturedBatch")
    MessageObject<List<PageFeaturedVO>> insertIndexFeaturedBatch(@RequestBody List<PageIndexFeaturedInsertDTO> list);

    /**
     * 修改首页Featured数据
     *
     * @param pageIndexFeaturedChangeDTO Featured数据修改DTO
     * @return 修改后的数据
     */
    @ApiOperation("修改首页Featured数据")
    @PostMapping("changeIndexFeatured")
    MessageObject<PageFeaturedVO> changeIndexFeatured(@RequestBody PageIndexFeaturedChangeDTO pageIndexFeaturedChangeDTO);

    /**
     * 根据id移除数据
     *
     * @param ids Featured据编号列表
     * @return 是否移除成功
     */
    @ApiOperation("根据id移除数据")
    @PostMapping("removeIndexFeaturedByIds")
    MessageObject<Boolean> removeIndexFeaturedByIds(@RequestBody List<Integer> ids);

}
